﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Valgmotor.Controller;
using Valgmotor.Interface;

namespace Valgmotor
{
    /// <summary>
    /// Interaction logic for InputData.xaml
    /// </summary>
    public partial class InputData : Window
    {
        ValgController valgCon;

        public InputData(ValgController Con)
        {
            InitializeComponent();
            
            valgCon = Con;

            cbValg.Items.Clear();
            foreach (IValg valg in valgCon.retunervalg)
            {
                cbValg.Items.Add(valg.Navn + " " + valg.Valgdato.Year + "-" + valg.Valgdato.Month +"-" + valg.Valgdato.Day);
            }
        }

        private void btn_opretValg_Click(object sender, RoutedEventArgs e)
        {
            var NewWindows = new OpretValg(valgCon);
            NewWindows.Show();
            this.Close();
        }
    }
}
